home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Answers 2002 January
/
PC Answers January 2002.7z
/
PC Answers January 2002.bin
/
graphics
/
freepixl
/
_SETUP.1
/
Environ.pxl
< prev
next >
Wrap
Text File
|
2000-03-20
|
3KB
|
126 lines
Initialize: {only one instance allowed}
UseCoordinates(PIXEL)
Title$ = "PiXCL Environment Block Commands"
WinExist(Title$,Res)
If Res = 0 Then Goto One_Instance
Beep
WinSetActive(Title$,Res)
WinShow(Title$,RESTORE,Res)
End
One_Instance:
UseCaption(Title$) {change the title}
WinLocate(Title$,288,154,746,420,Res)
UseBackground(TRANSPARENT,0,255,255)
WinShow(Title$,NOTOPMOST,Res)
DrawBackGround
DirGet(SourceDir$) {used later for library function calls}
InfoMenu(REMOVE)
WaitInput(100)
SetMenu("&File",IGNORE,
"&New",CreatingFile,
"&Open",OpeningFile,
"&Save",SavingFile,
SEPARATOR,
"E&xit!",Terminate,
ENDPOPUP,
"&Information",IGNORE,
"&Concept",Concept,
"&Help",ShowAppHelp,
SEPARATOR,
"About",About,
ENDPOPUP)
GoSub Make_Toolbar
Offset = 2
Wait_for_Input:
WaitInput()
Terminate:
TMP$ = SourceDir$ + "\*.TMP"
FileDelete(TMP$,Res)
End
Concept:
MessageBox(OK,1,INFORMATION,
"A Windows application can access and make use of the environment
block variables. These are copied to each process from the commands
listed originally in the CONFIG.SYS file, and stored by Windows.
There are PiXCL commands to read and write the local environment
block, and to list the currently defined variables.",
"PiXCL Environment Block Commands",Res)
Goto Wait_for_Input
ShowAppHelp:
{An application Help file usually has the same name as the application.}
Winhelp("test.hlp",CONTENTS,"")
Goto Wait_for_Input
About:
AboutUser("PiXCL Environment Block Commands",
"Demonstrate the available commands.","")
Goto Wait_for_Input
CreatingFile:
DrawBackground
SetEnvVariable("VAR01","blah 001",Res)
SetEnvVariable("VAR02","blah 002",Res)
SetEnvVariable("VAR03","blah 003",Res)
Chr(13,CR$)
GetEnvString(CR$,Env$)
MessageBox(OK,1,INFORMATION,Env$,"Environment Block Strings",Res)
DrawTextExt(0,30,800,500,Env$,LEFT)
Goto Wait_for_Input
OpeningFile:
UseFont("Arial",9,17,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
DrawBackground
FileGetTempName(SourceDir$,"pixcl",0,TempFile$)
DrawText(10,30,TempFile$)
FileGetTempName(SourceDir$,"pixcl",2,TempFile$)
DrawText(10,50,TempFile$)
GetTempPath(TempPath$)
TempPath$ = "TempPath = " + TempPath$
DrawText(10,70,TempPath$)
GetFontFace(Face$)
Face$ = "Current Font Face = " + Face$
DrawText(10,90,Face$)
GetEnvVariable("TMP",TMP$)
TMP$ = "TMP = " + TMP$
DrawText(10,110,TMP$)
GetEnvVariable("TEMP",TEMP$)
TEMP$ = "TEMP = " + TEMP$
DrawText(10,130,TEMP$)
Goto Wait_for_Input
SavingFile:
MessageBox(OK,1,EXCLAMATION,"Look at source code label 'SavingFile'","No function coded for this button",Res)
Goto Wait_for_Input
AcceptFile:
GetDragList(FileList$)
{TODO: add file list handling here, or delete this whole label handler}
Goto Wait_for_Input
Make_Toolbar:
Toolbar(RAISED, PXL_SMALL,
NULL, NULL, SEPARATOR, "", Wait_for_Input,
PXL_NEW, ENABLED, STD, "Set some Environment variables", CreatingFile,
PXL_OPEN, ENABLED, STD, "Show Environment variables", OpeningFile,
PXL_SAVE, ENABLED, STD, "FileSave", SavingFile,
NULL, NULL, SEPARATOR, "", Wait_for_Input,
PXL_SHOHLP, ENABLED, STD,"Show Help",ShowAppHelp)
Return